package config

import (
	"fmt"
	"github.com/spf13/viper"
)

type Mysql struct {
	Host     string
	Port     int
	User     string
	Password string
	Database string
}

type Redis struct {
	Host     string
	Port     int
	Password string
	Database int
}

type AppConfig struct {
	Mysql Mysql
	Redis Redis
}

var App AppConfig

func Init() {
	viper.SetConfigFile("config/zy17.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&App)
	fmt.Println("文件读取成功", App)
}
